//
//  DevInfraredHelper.h
//  SXIotSDK
//
//  Created by 林鑫 on 2020/2/18.
//

#import <Foundation/Foundation.h>
#import "DeviceInfo.h"
#import "FuncInfo.h"

NS_ASSUME_NONNULL_BEGIN

@interface DevInfraredHelper : NSObject

+(void)gatewayStudy:(NSInteger) deviceId zkId:(NSString*)zkId callback:(void(^)(DeviceInfo* deviceInfo, NSError* error))callback;

+(void)storage:(NSInteger) deviceId zkId:(NSString*)zkId callback:(void(^)(DeviceInfo* deviceInfo, NSError* error))callback;

+(void)oneClickStudy:(NSInteger)deviceId zkId:(NSString*)zkId callback:(void(^)(DeviceInfo* deviceInfo, NSError* error))callback;

+(void)custBtnStudy:(NSInteger)funcId zkId:(NSString*)zkId callback:(void(^)(FuncInfo* funcInfo, NSError* error))callback;

+(void)queryConfig:(NSInteger)deviceId zkId:(NSString*)zkId;

+(void)queryConfig:(NSInteger)deviceId zkId:(NSString*)zkId callback:(void(^)(NSDictionary<NSString*, id>* funcInfo, NSError* error))callback;


/**
 *
 * @param deviceId deviceId
 * @param funcId funcCode A1 风扇开
 */
+(void)control:(NSInteger)deviceId funcId:(NSInteger)funcId zkId:(NSString*)zkId callback:(void(^)(NSDictionary<NSString*, id>* map, NSError* error))callback;

+(void)delBtn:(NSInteger)deviceId funcId:(NSInteger)funcId zkId:(NSString*)zkId callback:(void(^)(id funcInfo, NSError* error))callback;

+(void)removeBtn:(NSInteger)deviceId funcId:(NSInteger)funcId zkId:(NSString*)zkId callback:(void(^)(id funcInfo, NSError* error))callback;

+(void)clearByType:(NSInteger)deviceId routeIndex:(NSString*)routeIndex zkId:(NSString*)zkId callback:(void(^)(id funcInfo, NSError* error))callback;

/**
 * 用于zigbee红外清除所有设备，有红外发射器和网关作为传输
 * @param deviceId deviceId
 */
+(void)clearAll:(NSInteger)deviceId zkId:(NSString*)zkId callback:(void(^)(NSDictionary<NSString*, id>* funcInfo, NSError* error))callback;

/**
 * 用于wifi红外清楚所有设备，只有发射器和服务器做交互
 * @param zkId zkId
 * @param callback onDataLoadedListener
 */
+(void)clearAllByZK:(NSString*)zkId callback:(void(^)(NSDictionary<NSString*, id>* funcInfo, NSError* error))callback;

+(void)removeDev:(NSInteger)deviceId zkId:(NSString*)zkId callback:(void(^)(DeviceInfo* deviceInfo, NSError* error))callback;

/**
 * 设置默认语音控制的设备
 * @param deviceId deviceId
 */
+(void)setDefault:(NSInteger)deviceId zkId:(NSString*)zkId;

/**
 * 获取默认语音控制的设备
 * @param deviceId deviceId
 */
+(void)getDefault:(NSInteger)deviceId zkId:(NSString*)zkId callback:(void(^)(DeviceInfo* deviceInfo, NSError* error))callback;

/**
 * 获取网关缓存的设备
 * @param deviceId deviceId
 * @param routeIndex routeIndex
 */
+(void)queryStorageDevs:(NSInteger)deviceId routeIndex:(NSString*)routeIndex index:(NSInteger)index zkId:(NSString*)zkId callback:(void(^)(NSDictionary<NSString*, id>* funcInfo, NSError* error))callback;

+(void)getStorageList:(NSInteger)deviceId routeIndex:(NSString*)routeIndex zkId:(NSString*)zkId callback:(void(^)(NSArray<NSString*>* dataList, NSError* error))callback;

+(NSString*)getRouteIndexByCateCode:(NSString*)cateCode;

+(NSDictionary<NSString*, id>*)parseParamByDeviceId:(NSInteger)deviceId zkId:(NSString*)zkId param:(NSDictionary<NSString*, id>*)param;

+(NSDictionary<NSString*, id>*)parseParam:(DeviceInfo*)deviceInfo param:(NSDictionary<NSString*, id>*)param;

+(NSArray<FuncInfo*>*)getDefaultFuncList:(DeviceInfo*)deviceInfo;

+(NSArray<FuncInfo*>*)getChooseFuncList:(NSInteger*)sortType;

+(BOOL)isStorageGet:(NSInteger)deviceId zkId:(NSString*)zkId;

+(BOOL)isFuncStudy:(NSInteger)funcId zkId:(NSString*)zkId;

@end

NS_ASSUME_NONNULL_END
